import Vue from 'vue'
import VueRouter from 'vue-router'
//导入需要用到的组件
import Home from '../views/Home.vue'
import City from '../views/City.vue'
import Detail from '../views/Detail.vue'

Vue.use(VueRouter)

const routes = [
	{path:'/home',component:Home},
	{path:'/',redirect:'/home'},
	{path:'/city',component:City},
	{path:'/detail/:id',component:Detail}
]

const router = new VueRouter({
  routes
})

export default router
